<#include "app/bid/filters/filter-for-bid-list.ftl">

<table class="table-bid-list" data-page="${page!1}" data-page="${page!'1'}" data-count="${count!'0'}" data-page-size="${pageSize!'30'}">
	<tr class="title-row">
		<th class="text-center" width="45">序号</th>
		<th class="text-center">项目编号</th>
		<th class="text-center">项目名称</th>
		<th class="text-center" width="120">招标方式</th>
		<th class="text-center">招标单位</th>
		<th class="text-center">招标编号</th>
		<th class="text-center">代理机构</th>
		<th class="text-center" width="136">开标时间</th>
		<th class="text-center" width="73">投标结果</th>
		<th class="text-center">报价情况</th>
		<th class="text-center">备注</th>
	</tr>
	<#if data??> <#list data as b>
	<tr onclick="window.open('${request.contextPath}/bid/view/${b.id}','_blank');" style="cursor: pointer;">
		<td class="text-center">${b_index + 1}</td>
		<td class="text-center">${b.projectNo}</td>
		<td>${b.name}</td>
		<td class="text-center">${b.bidWay}</td>
		<td class="text-center">${b.biddingerInfo.biddinger.company!'-'}</td>
		<td class="text-center">${b.bidNo}</td>
		<td class="text-center">${b.bidAgencyInfo.agency.company}</td>
		<td class="text-center">${b.openingTime?string('yyyy-MM-dd HH:mm')}</td>
		<td class="text-center ${('B0003_WIN'==b.status)?string('text-danger font-bold', '')}">${b.status.value}</td>
		<td class="text-center">${b.quotationString}</td>
		<td class="text-center">${b.remark}</td>
	</tr>
	</#list> </#if>
</table>

<script src="${request.contextPath}/js/suredy-list.js"></script>
<script src="${request.contextPath}/js/suredy-datetimepicker.js"></script>
<script src="${request.contextPath}/core/js/jquery.form.js"></script>
<script type="text/javascript">
	$(function() {
		$.suredy.datetimepicker.init();

		var doSearch = function(page, pageSize) {
			var form = $('form.filter-form');

			form.ajaxSubmit({
				dataType : 'html',
				data : {
					page : page,
					pageSize : pageSize
				},
				success : function(html, textStatus, jqXHR) {
					if (!html)
						return false;

					$('div.suredy-content').html(html);
				},
				error : function(jqXHR, textStatus, errorThrown) {
					return false;
				}
			});
		};

		$('table.table-bid-list').list({
			header : false,
			paginate : function(page, pageSize, key) {
				doSearch(page, pageSize);
			}
		});

		$('.filter-search').on('click', function() {
			doSearch(1, $('table.table-bid-list').data('page-size'));
		});

		$('.filter-reset').on('click', function() {
			$('form.filter-form input').val('');
			$('form.filter-form option:first-child').prop('selected', true);
		});
	});
</script>
